//
//  HTClassTabBarController.swift
//  QuitSmokingApp
//
//  Created by   on 2024/3/6.
//

import UIKit

class HTClassTabBarController: UITabBarController {
    lazy var var_home: HTClassNavigationController = {
        let var_view = HTClassHomeVC()
        let var_nav = HTClassNavigationController(rootViewController: var_view)
        var_nav.tabBarItem.selectedImage = UIImage(named: "icon_home_sel")
        var_nav.tabBarItem.image = UIImage(named: "icon_home")
        
        return var_nav
    }()
    
    lazy var var_statistics: HTClassNavigationController = {
        let var_view = HTClassStatisticsVC()
        let var_nav = HTClassNavigationController(rootViewController: var_view)
        var_nav.tabBarItem.selectedImage = UIImage(named: "icon_statistics_sel")
        var_nav.tabBarItem.image = UIImage(named: "icon_statistics")
        return var_nav
    }()
    
    lazy var var_calendar: HTClassNavigationController = {
        let var_view = HTClassCalendarVC()
        let var_nav = HTClassNavigationController(rootViewController: var_view)
        var_nav.tabBarItem.selectedImage = UIImage(named: "icon_clock_sel")
        var_nav.tabBarItem.image = UIImage(named: "icon_clock")
        return var_nav
    }()
    
    lazy var var_mine: HTClassNavigationController = {
        let var_view = HTClassMineVC()
        let var_nav = HTClassNavigationController(rootViewController: var_view)
        var_nav.tabBarItem.selectedImage = UIImage(named: "icon_person_sel")
        var_nav.tabBarItem.image = UIImage(named: "icon_person")
        return var_nav
    }()
    override func viewDidLoad() {
        super.viewDidLoad()
        ht_initNav()
        viewControllers = [var_home, var_statistics, var_calendar, var_mine]
    }
    
    func ht_initNav() {
        self.viewControllers = [var_home, var_statistics, var_calendar, var_mine]
        let var_appearance = UITabBar.appearance()
        let var_tabBarAppearance = UITabBarAppearance()
        var_tabBarAppearance.backgroundColor = UIColor("#FFFFFF")
        var_tabBarAppearance.stackedLayoutAppearance.normal.titleTextAttributes = [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 10, weight: .medium)]
        var_tabBarAppearance.stackedLayoutAppearance.selected.titleTextAttributes = [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 10, weight: .medium)]
        var_appearance.standardAppearance = var_tabBarAppearance
        var_appearance.scrollEdgeAppearance = var_tabBarAppearance
    }
    
    func getTabBarItemColor() {
        
    }
}
